<?php

/**
 * GameItemQuality form base class.
 *
 * @method GameItemQuality getObject() Returns the current form's model object
 *
 * @package    aiontoolskit
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseGameItemQualityForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'        => new sfWidgetFormInputHidden(),
      'name'      => new sfWidgetFormChoice(array('choices' => array('common' => 'common', 'epic' => 'epic', 'legend' => 'legend', 'mythic' => 'mythic', 'rare' => 'rare', 'unique' => 'unique'))),
      'hexaColor' => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'id'        => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'name'      => new sfValidatorChoice(array('choices' => array(0 => 'common', 1 => 'epic', 2 => 'legend', 3 => 'mythic', 4 => 'rare', 5 => 'unique'), 'required' => false)),
      'hexaColor' => new sfValidatorString(array('max_length' => 6, 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('game_item_quality[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'GameItemQuality';
  }

}
